package org.ctd.springframework.beans.factory.config;

import com.ctd.springframework.util.Assert;
import org.ctd.springframework.beans.BeanMetadataElement;

/**
 * BeanDefinitionHolder
 *
 * @author chentudong
 * @time 2019/3/25 1:19
 */
public class BeanDefinitionHolder implements BeanMetadataElement {
    private final BeanDefinition beanDefinition;

    public BeanDefinitionHolder(BeanDefinition beanDefinition) {
        Assert.notNull(beanDefinition, "BeanDefinition must not be null");
        this.beanDefinition = beanDefinition;
    }

    /**
     * getSource
     *
     * @return Object
     */
    @Override
    public Object getSource() {
        return this.beanDefinition.getSource();
    }
}
